#coding:utf-8

import datetime

from django.shortcuts import render
from django.views.generic import View

class Index(View):
    TEMPLATE = 'index.html'

    def get(self, request, name):
        # return render(request, self.TEMPLATE, {'name': 'demonlb'})

        # 定义一个列表
        data = {}
        data['name'] = name
        data['array'] = range(10)
        data['count'] = 20
        data['time'] = datetime.datetime.now()
        data['cut_str'] = 'hello-boy!'

        # return render(request, self.TEMPLATE, {'name': name})
        # 用上面的替换下面的
        return render(request, self.TEMPLATE, data)